---
category: Date Time
created: '2020-04-19'
title: Get the current timestamp in seconds
updated: '2021-10-13'
---

**JavaScript version**

```js ts.js
const ts = () => Math.floor(new Date().getTime() / 1000);
```

**TypeScript version**

```ts ts.ts
const ts = (): number => Math.floor(new Date().getTime() / 1000);
```
